﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business.Manager;
using Business.IManager;

namespace OnlinePayment.Admin
{
    public partial class AddRole : System.Web.UI.Page
    {
        IAccountManager accountManager = new AccountManager();
        protected void Page_Load(object sender, EventArgs e)
        {
            //进行权限检查
        }

        protected void btnAdd_Click(object sender, EventArgs e)
        {
            String roleName = txtRoleName.Text;
            List<bool> authoritys = new List<bool>();
            authoritys.Add(this.ceckboxSystemSet.Checked);
            authoritys.Add(this.ceckboxAnnounManage.Checked);
            authoritys.Add(this.ceckboxServiceManage.Checked);
            authoritys.Add(this.ceckboxProManage.Checked);
            authoritys.Add(this.ceckbocProPost.Checked);
            authoritys.Add(this.ceckboxUtilityManage.Checked);
            authoritys.Add(this.ceckboxUtilityPost.Checked);
            authoritys.Add(this.ceckBoxNetworkManage.Checked);
            authoritys.Add(this.ceckboxStuCardManage.Checked);
            if (accountManager.genneRoleInfor(authoritys, txtRoleName.Text))
            {
                RegisterStartupScript("", "<script>alert('添加成功！');</script>");
            }
            else
            {
                RegisterStartupScript("", "<script>alert('添加失败！')</script>");
            } 
        }

       
    }
}